home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************
- * trial.h - exported entry points into the 32 bit Trialware DLL
- ****************************************************************************
- * This module, both in source and in binary format, is wholly owned
- * and hereby expressly copyrighted by Pipeline.
- * Copyright 1994-1996 Pipeline Communications, Inc.
- * All rights reserved.
- ****************************************************************************/
- #ifndef _TRIAL_H
- #define _TRIAL_H
- // trialware status structure
- // used for returns
-
- #if defined(__cplusplus)
- extern "C" {
- #endif
-
- typedef struct _tw_status
- {
- DWORD dwVersion;
- DWORD dwFlags;
- DWORD dwDaysLeft;
- DWORD dwTimeLeft;
- DWORD dwExpDate;
- DWORD dwToken;
- HINSTANCE hInst;
- } TWSTATUS;
-
- typedef TWSTATUS * PTWSTATUS;
-
- #define PLTW_SECURE (0x00000001)
- #define PLTW_SET_DATE (0x00000002)
- #define PLTW_SET_DAYS (0x00000004)
- #define PLTW_ADD_DATE (0x00000008)
- #define PLTW_ADD_DAYS (0x00000010)
- #define PLTW_NO_ORDER (0x00000020)
- #define PLTW_ORDER_EXE (0x00000040)
- #define PLTW_NO_RESOURCE (0x00000080)
- #define PLTW_READ_ONLY (0x00000100)
- #define PLTW_UNLOCK (0x00000200)
- #define PLTW_FROMORDER (0x00010000)
-
- #define TW_INVALID_PARAM (-1)
- #define TW_FAILURE (0) // errors are <= 0
- #define TW_SUCCESS (1)
- #define TW_UNLOCKED (2)
-
- // function prototypes
- // alias the names of the api
- #define StartTrial PLSTW
- #define TestTrial PLTTW
- #define EndTrial PLETW
- int StartTrial(LPCSTR szLogin, PTWSTATUS stat);
- int TestTrial(LPCSTR szLogin, PTWSTATUS stat);
- int EndTrial(LPCSTR szLogin, PTWSTATUS stat);
-
- // macro for decoding secure return
-
- #define XCODE(token, encret, ret) \
- { BYTE *f = (BYTE *)&(token); \
- BYTE *t = (BYTE *)&(encret); \
- int i; \
- for (i = 0; i < 4; i++) \
- *(t+i) = *(f+i) ^ (ret); \
- }
-
- #if defined(__cplusplus)
- }
- #endif
-
- #endif
-